/**
  * Interleave two strings.
  * Assumes input parameters aren't null.
  */
def interleave(String a, String b) {
    assert a != null, 'First parameter must not be null'
    assert b != null, 'Second parameter must not be null'
    int maxlength = [a.size(), b.size()].max()
    def sb = new StringBuffer()
    (0..<maxlength).each{
        if (it < a.size()) sb << a[it]
        if (it < b.size()) sb << b[it]
    }
    sb
}

println interleave(null, 'World!')